


Namespace Ventas
Public Class ComprobanteDescuento



 Public Function Combo(ByVal vTodos As Boolean, Optional ByVal vmensaje As String = "Todos") As Entity.Ventas.ComprobanteDescuentoCol
dim objCol as  New entity.Ventas.ComprobanteDescuentoCol
dim obj as  New Data.Ventas.ComprobanteDescuento
objCol = obj.Listar("", _
		-1, _
		-1, _
		-1, _
		-1, _
		0.0, _
		0.0, _
		-1)
 If vTodos Then
Dim ent As New Entity.Ventas.ComprobanteDescuento( _ 
		-1, _
		vmensaje , _
		-1, _
		-1, _
		0.0, _
		0.0, _
		-1)
objCol.AddPrimero(ent)
End If
Return objCol
End Function


'***************************


public Function Listar(ComprobanteDescuentosId as integer) as Entity.Ventas.ComprobanteDescuento

dim objEnt as  New entity.Ventas.ComprobanteDescuento
dim obj as  New Data.Ventas.ComprobanteDescuento
return obj.Listar(ComprobanteDescuentosId)

End Function


'***************************



public Function Listar( _
		ComprobanteDescuentosId as Integer, _
		ComprobanteId as Integer, _
		DescuentoId as Integer, _
		Tipo as Integer, _
		Porcentaje as Double, _
		Monto as Double, _
		EStado as Integer) _
as  Entity.Ventas.ComprobanteDescuentoCol

dim objCol as  New entity.Ventas.ComprobanteDescuentoCol
dim obj as  New Data.Ventas.ComprobanteDescuento
return obj.listar("", _
		ComprobanteDescuentosId, _
		ComprobanteId, _
		DescuentoId, _
		Tipo, _
		Porcentaje, _
		Monto, _
		EStado)

End Function


'***************************


public Function Grabar( _
		ComprobanteDescuentosId as Integer, _
		ComprobanteId as Integer, _
		DescuentoId as Integer, _
		Tipo as Integer, _
		Porcentaje as Double, _
		Monto as Double, _
		EStado as Integer, _
vUSuario as integer)as  integer

dim _codigo as integer =-1
dim obj as  New Data.Ventas.ComprobanteDescuento
 if ComprobanteDescuentosId=-1 then 
_codigo= obj.insert( "", _
		ComprobanteDescuentosId , _
		ComprobanteId , _
		DescuentoId , _
		Tipo , _
		Porcentaje , _
		Monto , _
		EStado , _
 vUSuario )
else
_codigo= obj.update( "", _
		ComprobanteDescuentosId , _
		ComprobanteId , _
		DescuentoId , _
		Tipo , _
		Porcentaje , _
		Monto , _
		EStado , _
 vUSuario )
end if 
return _codigo

End Function


'***************************


public Function Insertar( _
		ComprobanteDescuentosId as Integer, _
		ComprobanteId as Integer, _
		DescuentoId as Integer, _
		Tipo as Integer, _
		Porcentaje as Double, _
		Monto as Double, _
		EStado as Integer, _
vUSuario as integer)as  integer

dim _codigo as integer =-1
dim obj as  New Data.Ventas.ComprobanteDescuento
_codigo= obj.insert( "", _
		ComprobanteDescuentosId, _
		ComprobanteId, _
		DescuentoId, _
		Tipo, _
		Porcentaje, _
		Monto, _
		EStado, _
 vUSuario )
return _codigo

End Function


'***************************


public Function Updatear( _
		ComprobanteDescuentosId as Integer, _
		ComprobanteId as Integer, _
		DescuentoId as Integer, _
		Tipo as Integer, _
		Porcentaje as Double, _
		Monto as Double, _
		EStado as Integer, _
vUSuario as integer)as  integer

dim _codigo as integer =-1
dim obj as  New Data.Ventas.ComprobanteDescuento
_codigo= obj.Update( "", _
		ComprobanteDescuentosId , _
		ComprobanteId , _
		DescuentoId , _
		Tipo , _
		Porcentaje , _
		Monto , _
		EStado , _
 vUSuario )
return _codigo

End Function


'***************************


public Function ELiminar(  ComprobanteDescuentosId as integer,vusuario as integer ,optional vopcion as string="Delete") as integer
dim _codigo as integer =-1
dim obj as  New Data.Ventas.ComprobanteDescuento
_codigo= obj.Eliminar( "vopcion", ComprobanteDescuentosId ,vusuario)
return _codigo

End Function

End Class



end namespace

